﻿package net.wangit.adm.user;

import net.wangit.LabelUtil;
import net.wangit.context.ActionContext;
import net.wangit.support.Validator;
import net.wangit.util.Checker;

public class AdministratorIdValidator implements Validator {

	public AdministratorIdValidator() {
	}

	public String validate(ActionContext ac, String value, String expression,
			int rowIndex) {
		if (Checker.isEmpty(value)
				&& 2 == ac.getRequestParameterInt("user.form.userlevel", 1))
			return LabelUtil.get(ac, "adm", "adminid.invalid");
		else
			return null;
	}

	public String validate(ActionContext ac, String from, String to, String s) {
		return null;
	}
}
